<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.List"%>
<%@ page import="activity.Activity"%>
<%@ page import="activity.Shop"%>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="javax.jdo.Query" %>
<%@ page import="activity.PMF" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>



<SCRIPT language="JavaScript" SRC="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></SCRIPT>
<SCRIPT laguage="JavaScript">
	var cal = new CalendarPopup();
</SCRIPT>

<title>點數需求</title>

</head>


<body>
<FORM NAME="example">
(View Source of this page to see the example code)<br>
<INPUT TYPE="text" NAME="date1" VALUE="" SIZE=25>
<A HREF="#"
   onClick="cal.select(document.forms['example'].date1,'anchor1','MM/dd/yyyy'); return false;"
   NAME="anchor1" ID="anchor1">select</A>
</FORM>

<%
	PersistenceManager pm = PMF.get().getPersistenceManager();
	Query query = pm.newQuery(Activity.class);  
%>

<%
	try {
		List<Activity> results = (List<Activity>) query.execute();		
%> 
<p>需求點數上架</p>
<form id="form1" name="form1" method="post" action=/activity/addDemand>

<p>需求商家名稱：
	
	<select id="sel_seller" name="actShop_d" onChange="renew(this.selectedIndex);">
	<%	
	for(Activity a:results){		
	%>
		<option value="<%=a.getActShop() %>"><%=a.getActShop() %></option>
	<%
	}
	%>
	</select>	

		
	
<p>需求活動名稱：
  <select id="actName" name="actName_d"> 
  		
		<option>萊爾富</option>
 
</select>			
	
<%
  }finally {
	    query.closeAll();
	}
%>
    

</p>

  <p>需求點數數量：
    <label>
      <input type="text" name="actPoint_d"/>
    </label>
  </p>
  <p>需求截止日：<input type="text" name="actEnd_d"/></p>
  
  <p>需求描述： 
  <textarea name="actContent_d"> </textarea></p>
  -----------------------------------------------------	
  
  <p>提供商家名稱：<input type="text" name="actShop_s"/></p>
  <p>提供活動名稱：<input type="text" name="actName_s"/></p>
  
  
  <p>提供點數數量：
    <label>
      <input type="text" name="actPoint_s"/>
    </label>
  </p>

  	
<input type="submit" value="我要上傳" />  	
</form>

<p>&nbsp;</p>
</body>
</html>
